package com.peanut.baby.mvp.liveroom;

import android.app.Activity;

import com.peanut.baby.model.LiveMsg;
import com.peanut.baby.model.UploadConf;
import com.peanut.baby.mvp.BasePresenter;
import com.peanut.baby.mvp.BaseView;

import java.util.List;

/**
 * Created by anonymouslystudio on 2017/7/24.
 */

public interface LiveRoomContract {
    interface View extends BaseView{
        void onMessageListGet(List<LiveMsg> messages);
        void onRequestFailed(String failReason);
        void onSendMessageSuccess(LiveMsg message);
        void onPicturePermissionGranted();
        void onPicturePermissionDenied();
        void onAudioPermissionGranted();
        void onAudioPermissionDenied();
        void onCameraPermissionGranted();
        void onCameraPermissionDenied();
        void onUploadPictureFinished(boolean success, String failReason, UploadConf config);
        void sendMessage(LiveMsg msg);
        void onUploadAudioFinished(boolean success, String failReason, UploadConf config);
    }

    interface Presenter extends BasePresenter{
        void sendMessage(LiveMsg message, String roomId);
        void getMessageList(String lastMessageId, String roomId);
        void checkPicturePermission(Activity act);
        void checkAudioPermission(Activity act);
        void checkCameraPermission(Activity act);
        void compressAndUploadPhoto(String path);
        void uploadAudio(String path, long duration);
    }
}
